home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / spawn_console.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.5 KB  |  47 lines

  1. ## spawn_console
  2. # This script tests all the various flavors of spawn:
  3. # 1. Asynchronous spawn of batch file
  4. # 2. Asynchronous spawn of batch file (detached)
  5. # 3. Synchronous spawn of batch file
  6. # 4. Asynchronous spawn of EXE file
  7. # 5. Asynchronous spawn of EXE file (detached)
  8. # 6. Synchronous spawn of EXE file
  9. # Assumptions:
  10. # 1. a batch file ConsoleTest.bat exists in the PATH (prints commandline)
  11. # 3. an EXE file ConsoleExe.exe exists in the PATH (prints commandline)
  12. {
  13.     -name spawn_console
  14.     -start 
  15.     -stop
  16.  
  17. ##########################################################################
  18. ## Spawn batch files:
  19.  
  20. #    Asynchronous Spawn of a batch file *SUCCEEDS*
  21. #    -command ConsoleTest hello world (asynchronous)
  22.  
  23. #    Asynchronous Detached Spawn of a batch file *FAILS*
  24. #    -command -detach ConsoleTest hello world (detach)
  25.  
  26. #    Asynchronous Detached Spawn of CMD.EXE to execute a command *SUCCEEDS*
  27. #    -command -detach cmd /c copy c:\temp\foo.txt c:\temp\foo.fox
  28.  
  29. #    Synchronous Spawn of a batch file *SUCCEEDS*
  30. #    -command -wait ConsoleTest hello world (synchronous)
  31.  
  32. ##########################################################################
  33. ## Spawn .EXE files:
  34.  
  35. #    Asynchronous Spawn of a .EXE file *SUCCEEDS*
  36. #    -command ConsoleExe hello world (asynchronous)
  37.  
  38. #    Asynchronous Detached Spawn of a .EXE file *SUCCEEDS*
  39. #    -command -detach ConsoleExe hello world (detach)
  40.  
  41. #    Synchronous Spawn of a .EXE file *SUCCEEDS*
  42. #    -command -wait ConsoleExe hello world (synchronous)
  43.  
  44.     -action -print ok detach test complete!
  45. }
  46.